package com.pj.point.adapter;

import android.annotation.SuppressLint;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.pj.point.R;
import com.pj.point.litepal.PointJavaBean;

import java.util.Calendar;
import java.util.List;

public class PointListAdapter extends MyAdapter{
    List<PointJavaBean> data;
    Calendar calendar;
    public PointListAdapter(List<PointJavaBean> data) {
        super(data);
        this.data = data;
        calendar = Calendar.getInstance();
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        @SuppressLint("ViewHolder") View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.point_list_item, null);
        TextView textView = view.findViewById(R.id.point_item_text);
        textView.setText(data.get(position).getTitle());
        if (data.get(position).getState() == 2) {
            ImageView imageView = view.findViewById(R.id.point_item_done);
            imageView.setVisibility(View.VISIBLE);
        }
        return view;
    }
}
